package io.renren.modules.pet.enums;

import lombok.Getter;

@Getter
public enum ApplicantWorkStatusEnum {

    STATUS_0(0, "无业"),
    STATUS_1(1, "学生"),
    STATUS_2(2, "工作"),
    STATUS_3(3, "退休");

    private Integer index;
    private String chn;

    ApplicantWorkStatusEnum(Integer index, String chn) {
        this.index = index;
        this.chn = chn;
    }

    /**
     * 通过索引获取中文表示
     * @param index
     * @return
     */
    public static String getChnByIndex (int index) {
        ApplicantWorkStatusEnum[] applicantWorkStatusEnums = ApplicantWorkStatusEnum.values();
        for (ApplicantWorkStatusEnum applicantWorkStatusEnum : applicantWorkStatusEnums) {
            if (applicantWorkStatusEnum.index.equals(index)) {
                return applicantWorkStatusEnum.chn;
            }
        }
        return null;
    }
}
